package dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import pojo.Food;
//写了这个注解可以 不用mapper文件
@Mapper
public interface FoodDAO {
	
	@Select("select * from food")
	public List<Food> queryAll();
	
	@Select("<script>"
			+ "select * from food"
			+ "<where>"
			+ "<if test='title!=null and title!=\"\"'>"
			+ " and title like '%'||#{title}||'%'"
			+ "</if>"
			+ "</where>"
			+ "</script>")
	public List<Food> queryByLike(Food food);
	
}




